﻿#ifndef TDS_H
#define TDS_H
#include "typedef.h"

#define TDS_SWITCH_TIME 5000
#define BEST_HIGH_WATER 5000
#define TDS_COEFFICIENT       (68U)     /* TDS = 0.68 * 电子传导率*/

namespace water {

//TDS计算
int R_TDS_Calculate(uint16_t adc, uint16_t temperature);

void refresh_TDS_data(int tds1, int tds2, int ad);

//获取当前TDS数据
unsigned int get_TDS1();
unsigned int get_TDS2();

//设置当前TDS数据
void set_TDS1(int tds);
void set_TDS2(int tds);


//保存TDS数据
// void save_tds(int tds1, int tds2);
void save_tds();


//断电后恢复TDS数据
int get_tds1();
int get_tds2();

void init_tds();

}

#endif
